home *** CD-ROM | disk | FTP | other *** search
- /******************************************************************************
-
- Stamper.c
-
- This file is furnished to you by Adobe Systems Incorporated
- under the terms of the Acrobat(r) Plug-ins Software
- Development Kit License Agreement.
-
- Copyright (C) 1994-1997, Adobe Systems Inc. All Rights Reserved.
-
-
- Implementation of the handshaking and initialization code
- for Stamper, a plug-in that demonstrates a simple annotation
- handler.
-
- To see the callbacks, #define the DEBUGWIN macro and install
- the DebugWin plug-in.
-
- ******************************************************************************/
-
- #include "PICommon.h"
- #include "CorCalls.h"
- #include "stampah.h"
- #include "stampui.h"
- #include "AVCalls.h"
-
- ASAtom Stamper_K;
- ASAtom Annotation_K;
-
-
- #define DEBUGWIN 0
- #include "debugger.h"
- HFT gDebuggerWindowHFT;
- static ACCB1 ASBool ACCB2 importHFTs(void)
- {
- gDebuggerWindowHFT = ASExtensionMgrGetHFT(ASAtomFromString("ADBE_DebuggerWindow"), 1);
- return true;
- }
-
- static ACCB1 ASBool ACCB2 StamperInit(void)
- {
-
- AVAppRegisterNotification(AVAppDidInitializeNSEL,0, SetUpStamperAnnotHandler, NULL);
- SetUpUI();
- if (gDebuggerWindowHFT)
- ShowDebuggerWindow();
-
- return true;
- }
-
- static ACCB1 ASBool ACCB2 Stamper_Unload(void)
- {
-
- AVAppUnregisterNotification(AVAppDidInitializeNSEL,0, SetUpStamperAnnotHandler, NULL);
- CleanUpUI();
- return true;
- }
- /*
- ** PIHandshake
- ** Required Plug-in handshaking routine: Do not change it's name!
- */
- ACCB1 ASBool ACCB2 PIHandshake(Uns32 handshakeVersion, void *handshakeData)
- {
- /* hmmmm, I wonder if I should change the name of Stamper_K? */
- Stamper_K = ASAtomFromString("ADBE_Stamper");
- Annotation_K = ASAtomFromString("Annotation");
-
- if (handshakeVersion == HANDSHAKE_V0200)
- {
- PIHandshakeData_V0200 *hsData = (PIHandshakeData_V0200 *)handshakeData;
-
- hsData->extensionName = ASAtomFromString("ADBE_AppleScript");
- #if DEBUGWIN
- hsData->importReplaceAndRegisterCallback = ASCallbackCreateProto( PIImportReplaceAndRegisterProcType, &importHFTs);
- #endif
- hsData->initCallback = ASCallbackCreateProto(PIInitProcType, &StamperInit);
-
- hsData->unloadCallback = Stamper_Unload;
- return true;
- }
-
- /*
- ** If we reach here, then we were passed a handshake version number we don't know about.
- ** This shouldn't ever happen since our main() routine chose the version number.
- */
- return false;
- }
-